home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 April / PCWorld_2008-04_cd.bin / komercni software / miton / SystemMechanic7Pro.exe / {app} / smhtml.dll / 1033 / HTML / AUTOMATICTASK.JS < prev    next >
Text File  |  2008-01-24  |  2KB  |  69 lines

  1.  
  2.  
  3. function AutomaticTaskTable()
  4. {
  5.   this.ID = "tblAutomaticTask";
  6.   this.tbl = new DataTable();
  7.   this.tbl.ID = this.ID;
  8.   this.tbl.Cellspacing = "0";
  9.   this.tbl.Cellpadding = "0";
  10.   this.tbl.Width = "100%";
  11.   this.tbl.Class = "module_items list";
  12.   this.tbl.Border = "0";
  13.   
  14.   this.Add = __AutomaticTaskTableAdd;
  15.   
  16.   //obj : AutomaticTask
  17.   function __AutomaticTaskTableAdd(obj)
  18.   {
  19.     var heading = "<span class=\"module_item_heading\"> " + obj.Heading + " </span>" + obj.Detail;
  20.     
  21.     var button = "<div style=\"text-align:right;\" id=\"divBtn_" + obj.ID + "\"  class=\"action_buttons_col\">";
  22.    
  23.    if( obj.Enabled )
  24.       button +=  obj._EnableButton; 
  25.    else   
  26.       button += obj._DisableButton;
  27.    obj += "   </div>";
  28.   
  29.     this.tbl.Add(heading, button );
  30.     this.tbl.ChangeClassInRowByIndex(0, "toprow");
  31.   }
  32. }
  33.  
  34.  
  35. function AutomaticTask(id)
  36. {
  37.  this.ID = id;
  38.  this.Heading = "heading";
  39.  this.Detail = "Detail";
  40.  this.Enabled = false;
  41.  
  42.  this._EnableButton = "<img src="+btLOC_img_Enabled+" onmousedown=\"this.src=btLOC_img_EnabledToDisabled\"    onmouseout=\"this.src=btLOC_img_Enabled\" onmouseover=\"this.src=btLOC_img_Enabled_hover\" onclick=\"external.DoOnTaskEnableClick('" + this.ID + "')\" class=\"hand\"  border=\"0\" />";
  43.  this._DisableButton = "<img src="+btLOC_img_Disabled+"  onmousedown=\"this.src=btLOC_img_DisabledToEnabled\"    onmouseout=\"this.src=btLOC_img_Disabled\" onmouseover=\"this.src=btLOC_img_Disabled_hover\"  onclick=\"external.DoOnTaskEnableClick('" + this.ID + "')\"  class=\"hand\"  border=\"0\" />";
  44.  
  45.  this.Render = __AutomaticTaskRender;
  46.  this.IsRendered = __AutomaticTaskIsRendered;
  47.  this.Enable = __AutomaticTaskEnable;
  48.  
  49.  
  50. function __AutomaticTaskIsRendered()
  51. {
  52.   return  Get( "divBtn_" + this.ID ) == null ? false : true;
  53. }
  54.  
  55.  function __AutomaticTaskRender()
  56.  {
  57.    var html = "";
  58.    return "";
  59.  }
  60.  
  61.  //value: bool
  62.  function __AutomaticTaskEnable(value)
  63.  {
  64.    if(this.IsRendered())
  65.        Get("divBtn_" + this.ID).innerHTML = value ? this._EnableButton : this._DisableButton ;
  66.  }
  67. }
  68.  
  69.